﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Leap;
using RecognitionAPI;

namespace ASL_BATTLE
{
    class SignDetection
    {
        readonly PublicAPI _lessonSlideAlphabet;
        private Controller _controller = new Controller();
        public SignDetection(bool letters, bool numbers)
        {
            _lessonSlideAlphabet = new PublicAPI(letters, numbers);
            GetListener().SetDetectionMode(true);
            GetController().AddListener(GetListener());
        }
        private PublicAPI GetListener()
        {
            return _lessonSlideAlphabet;
        }
        private Controller GetController()
        {
            return _controller;
        }
        public void SetLetter(string letter)
        {
            _lessonSlideAlphabet.SetPhrase(letter);
            _lessonSlideAlphabet.SetPhraseLength();
        }
        public bool currentLetter()
        {
            // return _lessonSlideAlphabet.GetLetterPhrase();
            switch (_lessonSlideAlphabet.GetLetterPhrase())
            {

                case "A":
                    return GetListener().LetterA(GetController().Frame(0).Fingers);
                case "B":
                    return GetListener().LetterB(GetController().Frame(0).Fingers);
                case "C":
                    return GetListener().LetterC(GetController().Frame(0).Fingers);
                case "D":
                    return GetListener().LetterD(GetController().Frame(0).Fingers);
                case "E":
                    return GetListener().LetterE(GetController().Frame(0).Fingers);
                case "F":
                    return GetListener().LetterF(GetController().Frame(0).Fingers);
                case "G":
                    return GetListener().LetterG(GetController().Frame(0).Fingers);
                case "H":
                    return GetListener().LetterH(GetController().Frame(0).Fingers);
                case "I":
                    return GetListener().LetterI(GetController().Frame(0).Fingers);
                case "J":
                    return GetListener().LetterJ(GetController().Frame(0).Fingers);
                case "K":
                    return GetListener().LetterK(GetController().Frame(0).Fingers);
                case "L":
                    return GetListener().LetterL(GetController().Frame(0).Fingers);
                case "M":
                    return GetListener().LetterM(GetController().Frame(0).Fingers);
                case "N":
                    return GetListener().LetterN(GetController().Frame(0).Fingers);
                case "O":
                    return GetListener().LetterO(GetController().Frame(0).Fingers);
                case "P":
                    return GetListener().LetterP(GetController().Frame(0).Fingers);
                case "Q":
                    return GetListener().LetterQ(GetController().Frame(0).Fingers);
                case "R":
                    return GetListener().LetterR(GetController().Frame(0).Fingers);
                case "S":
                    return GetListener().LetterS(GetController().Frame(0).Fingers);
                case "T":
                    return GetListener().LetterT(GetController().Frame(0).Fingers);
                case "U":
                    return GetListener().LetterU(GetController().Frame(0).Fingers);
                case "V":
                    return GetListener().LetterV(GetController().Frame(0).Fingers);
                case "W":
                    return GetListener().LetterW(GetController().Frame(0).Fingers);
                case "X":
                    return GetListener().LetterX(GetController().Frame(0).Fingers);
                case "Y":
                    return GetListener().LetterY(GetController().Frame(0).Fingers);
                case "Z":
                    return GetListener().LetterZ(GetController().Frame(0).Fingers);
                default:
                    return false;


            }
        }
    }
}
